package com.myfum.wingplayer.utils
{
	import com.myfum.wingplayer.entity.ProjectData;
	import com.myfum.wingplayer.events.FileEvent;
	import com.myfum.wingplayer.events.TaskEvent;
	import com.myfum.wingplayer.model.ProgramLocator;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.events.TimerEvent;
	import flash.filesystem.File;
	import flash.net.URLRequest;
	import flash.utils.Timer;
	
	import mx.core.FlexGlobals;
	
	import org.robotlegs.mvcs.Actor;
	
	public class TaskManager extends Actor
	{
		[Inject]
		public var fileManager:FileManager;
		[Inject]
		public var locator:ProgramLocator;
		
		public function TaskManager()
		{
			init();
		}
		
		private var _runner:Timer;
		
		private function init():void{
			_runner = new Timer(3000);
			_runner.addEventListener(TimerEvent.TIMER, run);
			_runner.start();
		}
		
		public function retrieve():void{
			var e:TaskEvent = new TaskEvent(TaskEvent.CHECK_TASK);
			eventDispatcher.dispatchEvent(e);
		}
		
		private function run(e:TimerEvent):void{
			retrieve();
		}
	}
}





